Add a function to get the selection of a clipboard
authorMatthias Clasen <mclasen@redhat.com>
Sun, 27 Mar 2016 03:30:21 +0000 (23:30 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 27 Mar 2016 03:30:21 +0000 (23:30 -0400)
This was requested in
http://bugzilla.gnome.org/show_bug.cgi?id=730821

docs/reference/gtk/gtk3-sections.txt
gtk/gtkclipboard.c
gtk/gtkclipboard.h

index d8688da01abf9ebdbd554cd22cd42f3ef16a87f4..36b3bacf3b5634835dda4d984608f27e8942c4d5 100644 (file)
@@ -6625,6 +6625,7 @@ gtk_clipboard_wait_for_targets
 gtk_clipboard_wait_is_target_available
 gtk_clipboard_set_can_store
 gtk_clipboard_store
+gtk_clipboard_get_selection
 <SUBSECTION Standard>
 GTK_CLIPBOARD
 GTK_TYPE_CLIPBOARD
index 5f53d8cd76736b8433131d61b745b37cf3fc126e..59cca40e493a26149cd3c733a3ae749e3587f9d2 100644 (file)
@@ -2208,3 +2208,21 @@ _gtk_clipboard_store_all (void)
   g_slist_free (displays);
   
 }
+
+/**
+ * gtk_clipboard_get_selection:
+ * @clipboard: a #GtkClipboard
+ *
+ * Gets the sleection that this clipboard is for.
+ *
+ * Returns: the selection
+ *
+ * Since: 3.22
+ */
+GdkAtom
+gtk_clipboard_get_selection (GtkClipboard *clipboard)
+{
+  g_return_val_if_fail (GTK_IS_CLIPBOARD (clipboard), GDK_NONE);
+
+  return clipboard->selection;
+}
index ffd801f4cc80e0931e3c8b55f9eec98f309ade5a..655c18fcda4e78ab6fe9f5b6009d55d405512598 100644 (file)
@@ -290,6 +290,8 @@ void gtk_clipboard_set_can_store (GtkClipboard         *clipboard,
 GDK_AVAILABLE_IN_ALL
 void gtk_clipboard_store         (GtkClipboard   *clipboard);
 
+GDK_AVAILABLE_IN_3_22
+GdkAtom gtk_clipboard_get_selection (GtkClipboard *clipboard);
 
 G_END_DECLS